package com.fengmi.portal.controller;

import com.fengmi.entity.cms.CmsContent;
import com.fengmi.entity.vo.CatCascadeVO;
import com.fengmi.entity.vo.CatHotVo;
import com.fengmi.portal.service.IPortalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("portal")
public class PortalController {

    @Autowired
    private IPortalService portalService;
    @RequestMapping("findContentByCatId/{catId}")
    public List<CmsContent> findContentByCatId(@PathVariable("catId")String catId){
        return portalService.findContentByCatId(catId);
    }

    @RequestMapping("findMenu")
    public List<CatCascadeVO> findMenu(){
        return portalService.findCatCascade();
    }

    @RequestMapping("findCatHotGoods")
    public List<CatHotVo> findCatHotGoods(){
        return portalService.findCatHotGoods();
    }
}
